
<?php include_once(dirname(__FILE__) . '/../general/head.php'); ?>

<!-- header -->
<?php include_once(dirname(__FILE__) . '/../general/header.php'); ?>

<?php //include_once('left.php'); ?>


<div id="page-wrapper" style="margin-left: auto;">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">
                <div style="text-align: center;">
                    Kết quả bài kiểm tra
                </div>
            </h1>

        </div>
    </div>
    <div class="row">
        <div class="col-lg-12"> 
            <div class="panel panel-default">
                <!--                <div class="panel-heading">
                                    Thông tin bài test
                                </div>-->
                <div class="panel-body" style="font-size: large;">
                    <p class="lead" style="text-align: center;"><?php echo $result->quiz_name; ?></p>
                    <p>
                    <table>
                        <tr>
                            <td width="250px">Họ tên nhân viên:</td>
                            <td><?php echo $loggedUser['name']; ?></td>
                        </tr>
                        <tr>
                            <td>Chức vụ:</td>
                            <td><?php show_human_title($loggedUser['title']); ?></td>
                        </tr>
                    </table>
                    </p>
                    
                    <p> 
                    <table>
                        <tr>
                            <td width="250px">Số câu đúng: </td>
                            <td><?php echo $result->score . "/" . (count(explode(',', $result->qids)) * $result->correct_score ); ?></td>
                        </tr>
                        <tr>
                            <td>Thời gian làm bài: </td>
                            <td><?php
                                if ($result->time_spent <= ($result->duration * 60 )) {
                                    echo gmdate("H:i:s", $result->time_spent);
                                } else {
                                    echo gmdate("H:i:s", ($result->duration * 60));
                                }
                                echo ' / ' . $result->duration;
                                ?> phút
                            </td>
                        </tr>
                        <tr>
                            <td>Tỉ lệ đạt: </td>
                            <td><?php echo substr($result->percentage, 0, 5); ?>%</td>
                        </tr>
<!--                        <tr>
                            <td>Kết quả: </td>
                            <td><?php
                                if ($result->q_result == "1") {
                                    echo "Đậu";
                                } else {
                                    echo "Rớt";
                                }
                                ?></td>
                        </tr>-->

                    </table>
                    </p>

                    <br>
                    <?php if ($result->view_answer == "1") { ?>

    <!--                        <a href="<?php echo site_url(get_folder($loggedUser['title']).'/results/view_answer/' . $result->rid); ?>">Xem đáp án</a>-->

                    <?php } ?>
                </div>

            </div>
            <a href="<?php echo site_url(get_folder($loggedUser['title']).'/quizzes'); ?>">Quay lại danh sách trắc nghiệm</a>
        </div>
    </div>


</div>
<!-- /#page-wrapper -->

<?php include_once(dirname(__FILE__) . '/../general/footer.php'); ?>